/**
 * 
 */
package com.bot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.bot.pojo.Applicant;
import com.bot.pojo.Job;
import com.bot.pojo.Score;


/**
 * @author zhaoyan
 *
 * 2020年2月3日
 */
public interface ApplicantMapper {

	/**
	 * @param flag
	 * @return
	 */
	List<Applicant> findApplicantList(Integer flag);

	/**
	 * @param applicant
	 * @return
	 */
	// <!--  	new Applicant(id, name, gender, birthday, college, major, edu, degree, created, strScore, avgScore) -->
	@Insert("INSERT INTO cctv_applicant VALUES(0,#{name},#{gender},#{birthday},#{college},#{major},#{edu},#{degree},now()")
	Integer addApplicant(Applicant applicant);
	
	
	
	@Insert("INSERT INTO cctv_score VALUES(#{aid},#{jid},#{preScore})")
	Integer addScore(Score score);

	/**
	 * @param aid
	 * @return
	 */
	@Select("SELECT * FROM cctv_applicant WHERE id = #{value}")
	Applicant findApplicant(Integer aid);

	/**
	 * @return
	 */
	@Select("SELECT * FROM cctv_job")
	List<Job> findJonList();

	/**
	 * @param id
	 * @return
	 */
	@Delete("DELETE FROM cctv_applicant WHERE id = #{value}")
	Integer delApp(Integer id);

	/**
	 * @param id
	 */
	@Delete("DELETE FROM cctv_score WHERE aid = #{value}")
	Integer delScore(Integer id);
	

}
